﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;


class CBinaryReader : BinaryReader
{
    public float m_fRate;
    int  m_nRawSize;
    long m_nFileSize;

    public CBinaryReader(String sFileName, float fRate)
        : base(File.OpenRead(sFileName))
    {
        m_fRate = fRate;
        m_nFileSize = BaseStream.Length;
        m_nRawSize = ReadInt16();
    }

    public List<float> GetListOfValues(int nParameterOffset)
    {
        List<float> Values = new List<float>();
        int nOffset = 2 + nParameterOffset;
        for (int nLine = 1; nOffset < (m_nFileSize-3); ++nLine)
        {
            BaseStream.Seek(nOffset, SeekOrigin.Begin);
            Values.Add(ReadSingle());
            nOffset = 2 + nLine * m_nRawSize + nParameterOffset;
        }

        return Values;
    }
}

